load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("build_infra")

rust_library(
    name = "buck2_resource_control",
    srcs = glob(
        ["src/**/*.rs"],
    ),
    os_deps = [
        (
            "linux",
            [
                "fbsource//third-party/rust:nix",
            ],
        ),
        (
            "macos",
            [
                "fbsource//third-party/rust:nix",
            ],
        ),
    ],
    test_deps = [
        "fbsource//third-party/rust:tempfile",
    ],
    test_env = {
        "PREP_CGROUP_SCRIPT": "$(location fbcode//buck2/shed/cgroups:prep_cgroup)",
    },
    deps = [
        "fbsource//third-party/rust:derive_more",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:index_vec",
        "fbsource//third-party/rust:ref-cast",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tokio-util",
        "fbsource//third-party/rust:tracing",
        "//buck2/allocative/allocative:allocative",
        "//buck2/app/buck2_common:buck2_common",
        "//buck2/app/buck2_core:buck2_core",
        "//buck2/app/buck2_data:buck2_data",
        "//buck2/app/buck2_error:buck2_error",
        "//buck2/app/buck2_events:buck2_events",
        "//buck2/app/buck2_fs:buck2_fs",
        "//buck2/app/buck2_util:buck2_util",
        "//buck2/app/buck2_wrapper_common:buck2_wrapper_common",
        "//buck2/gazebo/dupe:dupe",
    ],
)
